import { reqGetSearchInfo } from "@/api"
//search模块仓库
const state = {
    searchInfo:{}
}
const mutations={
    GETSEARCHINFO(state,searchInfo){
        state.searchInfo=searchInfo
    }
}
const actions={
    async getSearchInfo({commit},params={}){
        let result = await reqGetSearchInfo(params);
        //console.log(result.data);
        if(result.code==200){
            commit('GETSEARCHINFO',result.data)
        }
    }
}
//为了简化仓库数据而生
const getters={
    goodsList(state){return state.searchInfo.goodsList||[]},
    attrsList(state){return state.searchInfo.attrsList||[]},
    trademarkList(state){return state.searchInfo.trademarkList||[]},
}
 export default {
    state,
    mutations,
    actions,
    getters
 }